package com.bfsuol.bfsuolframework.core.servlet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.logicalcobwebs.proxool.ProxoolFacade;
import org.logicalcobwebs.proxool.admin.servlet.AdminServlet;

import javax.servlet.annotation.WebServlet;

/**
 * tomcat关闭前停掉连接池
 * @author wangzhuquan
 *
 */
@WebServlet(name = "ProxoolAdminServlet", urlPatterns = { "/proxoolAdmin.servlet" })
public class ProxoolAdminServlet extends AdminServlet {

	private static final long serialVersionUID = 3205095536164467920L;
	private static final Log LOG = LogFactory.getLog(AdminServlet.class);

	@Override
	public void destroy() {
		LOG.info("Proxool shoutdown.");
		ProxoolFacade.shutdown();
		super.destroy();
	}

}